// var o;
// exports.MissionData = void 0;
// var $storageClass = require("../../resources/scripts/AL_Framework_Storage_Class");
// var AL_GAME_HUA_Define = require("./AL_GAME_HUA_Define");
// var s = {
//     loginDaily: 0,
//     challengeDaily: 0,
//     watchAdDaily: 0,
//     levelDaily: 0,
//     crashDaily: 0,
//     useProp0: 0,
//     useProp1: 0,
//     useProp2: 0,
//     useProp3: 0,
//     useProp4: 0,
//     useProp5: 0,
//     useProp6: 0,
//     revive: 0,
//     boxRecieved: 0,
//     starBoxRecieved: 0,
//     share: 0,
//     watchAdTotal: 0,
//     levelTotal: 0,
//     dailyMissions: [],
//     dailyVIPMissions: [],
//     constMissions: []
// };
// var c = (function (e) {
//     function t() {
//         return (null !== e && e.apply(this, arguments)) || this;
//     }
//     __extends(t, e);
//     t.getInstance = function () {
//         return AL_APP_SDK_MANAGER.localManager.huoqu_cunchu_lei(t);
//     };
//     t.prototype.zhixing_chushihua_chuli = function () {
//         this.chushihua_cunchu_shuju(s);
//         this.chushihua_yuancheng_key(Object.keys(s));
//     };
//     t.prototype.shuaxin_riqi_xianguan_shuju = function () {
//         this.loginDaily = 1;
//         this.watchAdDaily = 0;
//         this.levelDaily = 0;
//         this.crashDaily = 0;
//         this.useProp0 = 0;
//         this.useProp1 = 0;
//         this.useProp2 = 0;
//         this.useProp3 = 0;
//         this.useProp4 = 0;
//         this.useProp5 = 0;
//         this.useProp6 = 0;
//         this.revive = 0;
//         this.boxRecieved = 0;
//         this.starBoxRecieved = 0;
//         this.share = 0;
//         this.dailyMissions = [];
//         this.dailyVIPMissions = [];
//     };
//     t.prototype.shuaxin_zhou_xianguan_shuju = function () {
//         this.watchAdTotal = 0;
//         this.levelTotal = 0;
//         this.constMissions = [];
//     };
//     t.prototype.jieshou_meiri_renwu = function (e) {
//         if (-1 == this.dailyMissions.indexOf(e)) {
//             this.dailyMissions.push(e);
//             this.shezhi_cunchu_shuju("dailyMissions", this.dailyMissions);
//             AL_APP_SDK_MANAGER.emit(AL_GAME_HUA_Define.GameEvent.ON_MISSION_CHANGE);
//         }
//     };
//     t.prototype.jieshou_meiri_renwu_vip = function (e) {
//         if (-1 == this.dailyVIPMissions.indexOf(e)) {
//             this.dailyVIPMissions.push(e);
//             this.shezhi_cunchu_shuju("dailyVIPMissions", this.dailyVIPMissions);
//             AL_APP_SDK_MANAGER.emit(AL_GAME_HUA_Define.GameEvent.ON_MISSION_CHANGE);
//         }
//     };
//     t.prototype.jieshou_changzhu_renwu = function (e) {
//         if (-1 == this.constMissions.indexOf(e)) {
//             this.constMissions.push(e);
//             this.shezhi_cunchu_shuju("constMissions", this.constMissions);
//             AL_APP_SDK_MANAGER.emit(AL_GAME_HUA_Define.GameEvent.ON_MISSION_CHANGE);
//         }
//     };
//     t.prototype.huoqu_meiri_renwu_shifou_yi_jieshou = function (e) {
//         return this.dailyMissions.indexOf(e) >= 0;
//     };
//     t.prototype.huoqu_meiri_renwu_vip_shifou_yi_jieshou = function (e) {
//         return this.dailyVIPMissions.indexOf(e) >= 0;
//     };
//     t.prototype.huoqu_changzhu_renwu_shifou_yi_jieshou = function (e) {
//         return this.constMissions.indexOf(e) >= 0;
//     };
//     t.bundle = AL_GAME_HUA_Define.Define.GAME_NAME;
//     t.key = "_e";
//     return t;
// })($storageClass.AL_Framework_Storage_Class);
// exports.MissionData = c;


// 用于存储公共变量的对象
const missionStatusDefaults = {
    loginDaily: 0,
    challengeDaily: 0,
    watchAdDaily: 0,
    levelDaily: 0,
    crashDaily: 0,
    useProp0: 0,
    useProp1: 0,
    useProp2: 0,
    useProp3: 0,
    useProp4: 0,
    useProp5: 0,
    useProp6: 0,
    revive: 0,
    boxRecieved: 0,
    starBoxRecieved: 0,
    share: 0,
    watchAdTotal: 0,
    levelTotal: 0,
    dailyMissions: [],
    dailyVIPMissions: [],
    constMissions: []
};

// 引入需要的外部类和定义
const storageClass = require('../../resources/scripts/AL_Framework_Storage_Class');
const lY01_HDPP_Define = require('./AL_GAME_HUA_Define');

/**
 * 任务数据类，负责处理与任务相关的数据管理
 */
class MissionData extends storageClass.AL_Framework_Storage_Class {
    static bundle = lY01_HDPP_Define.Define.GAME_NAME;
    static key = "_e";

    /**
     * 获取任务数据实例
     * 使用PPSDK本地管理器获取存储类
     */
    static getInstance() {
        return AL_APP_SDK_MANAGER.localManager.huoqu_cunchu_lei(MissionData);
    }

    /**
     * 初始化任务数据
     */
    zhixing_chushihua_chuli() {
        this.chushihua_cunchu_shuju(missionStatusDefaults);
        this.chushihua_yuancheng_key(Object.keys(missionStatusDefaults));
    }

    /**
     * 刷新每日任务状态
     */
    shuaxin_riqi_xianguan_shuju() {
        this.loginDaily = 1;
        Object.assign(this, {
            watchAdDaily: 0,
            levelDaily: 0,
            crashDaily: 0,
            useProp0: 0,
            useProp1: 0,
            useProp2: 0,
            useProp3: 0,
            useProp4: 0,
            useProp5: 0,
            useProp6: 0,
            revive: 0,
            boxRecieved: 0,
            starBoxRecieved: 0,
            share: 0,
            dailyMissions: [],
            dailyVIPMissions: [],
        });
    }

    /**
     * 刷新每周任务状态
     */
    shuaxin_zhou_xianguan_shuju() {
        Object.assign(this, {
            watchAdTotal: 0,
            levelTotal: 0,
            constMissions: [],
        });
    }

    /**
     * 接收每日任务
     * @param {any} mission 
     */
    jieshou_meiri_renwu(mission) {
        if (this.dailyMissions.indexOf(mission) === -1) {
            this.dailyMissions.push(mission);
            this.shezhi_cunchu_shuju('dailyMissions', this.dailyMissions);
            AL_APP_SDK_MANAGER.emit(lY01_HDPP_Define.GameEvent.ON_MISSION_CHANGE);
        }
    }

    /**
     * 接收每日VIP任务
     * @param {any} mission 
     */
    jieshou_meiri_renwu_vip(mission) {
        if (this.dailyVIPMissions.indexOf(mission) === -1) {
            this.dailyVIPMissions.push(mission);
            this.shezhi_cunchu_shuju('dailyVIPMissions', this.dailyVIPMissions);
            AL_APP_SDK_MANAGER.emit(lY01_HDPP_Define.GameEvent.ON_MISSION_CHANGE);
        }
    }

    /**
     * 接收常驻任务
     * @param {any} mission 
     */
    jieshou_changzhu_renwu(mission) {
        if (this.constMissions.indexOf(mission) === -1) {
            this.constMissions.push(mission);
            this.shezhi_cunchu_shuju('constMissions', this.constMissions);
            AL_APP_SDK_MANAGER.emit(lY01_HDPP_Define.GameEvent.ON_MISSION_CHANGE);
        }
    }

    /**
     * 检查每日任务是否已接收
     * @param {any} mission 
     * @returns {boolean}
     */
    huoqu_meiri_renwu_shifou_yi_jieshou(mission) {
        return this.dailyMissions.includes(mission);
    }

    /**
     * 检查每日VIP任务是否已接收
     * @param {any} mission 
     * @returns {boolean} 
     */
    huoqu_meiri_renwu_vip_shifou_yi_jieshou(mission) {
        return this.dailyVIPMissions.includes(mission);
    }

    /**
     * 检查常驻任务是否已接收
     * @param {any} mission 
     * @returns {boolean} 
     */
    huoqu_changzhu_renwu_shifou_yi_jieshou(mission) {
        return this.constMissions.includes(mission);
    }
}

exports.MissionData = MissionData;